﻿<%@ page language="C#" masterpagefile="~/_layouts/application.master" %>

<%@ register tagprefix="wssuc" tagname="InputFormSection" src="~/_controltemplates/InputFormSection.ascx" %>
<%@ register tagprefix="wssuc" tagname="InputFormControl" src="~/_controltemplates/InputFormControl.ascx" %>
<%@ register tagprefix="wssuc" tagname="ButtonSection" src="~/_controltemplates/ButtonSection.ascx" %>
<%@ register tagprefix="wssawc" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ register tagprefix="SPSWC" namespace="Microsoft.SharePoint.Portal.WebControls"
    assembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls"
    assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ register tagprefix="Utilities" namespace="Microsoft.SharePoint.Utilities" assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ register tagprefix="SG" namespace="AKJ.Sharepoint.Branding.Config" assembly="AKJ.Sharepoint.Branding, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adda199c4fc7387f" %>
<%@ import namespace="Microsoft.SharePoint" %>
<%@ import namespace="System.Xml" %>
<%@ import namespace="AKJ.Sharepoint.Branding.Config" %>

<script runat="server">
    SPWeb Web;
    
    protected override void OnLoad(EventArgs e) {
        base.OnLoad(e);
        Web = SPControl.GetContextWeb(Context).Site.RootWeb;

        if (!Page.IsPostBack) {
            SPProperties settings = new SPProperties(Web);
            
            tbXml.Text = settings.GetValue("DSRMBrandingData");
            
            settings = null;
        }
    }
    
    protected void OnClickOK(Object Sender, EventArgs e) {
        SPProperties settings = new SPProperties(Web);

        settings.SetValue("DSRMBrandingData", tbXml.Text);                
        settings = null;
        
        Response.Redirect("Settings.aspx");
    }
    
    protected void OnClickCancel(Object Sender, EventArgs e) {
        Response.Redirect("Settings.aspx");
    }
</script>

<asp:content id="Content2" contentplaceholderid="PlaceHolderPageTitle" runat="server">
    <SharePoint:EncodedLiteral ID="EncodedLiteral1" runat="server" Text="Auto Image Size Settings" EncodeMethod='HtmlEncode' />
</asp:content>
<asp:content id="Content3" contentplaceholderid="PlaceHolderPageTitleInTitleArea"
    runat="server">
    <SharePoint:EncodedLiteral ID="EncodedLiteral2" runat="server" Text="Auto Image Size Settings" EncodeMethod='HtmlEncode' />
</asp:content>
<asp:content id="Content1" contentplaceholderid="PlaceHolderPageImage" runat="server">
</asp:content>
<asp:content id="contentMain" contentplaceholderid="PlaceHolderMain" runat="server">
    <style type="text/css">
        table.ms-propertysheet
        {
            height: 100%;
        }
    </style>
    <table cellspacing="0" cellpadding="0" border="0" style="width: 100%; height: 100%" class="ms-settingsframe">
        <tr>
            <td width="100%" colspan="4" style="padding-top: 0px;">
                <table class="ms-pageinformation" width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td valign="top" style="padding: 10px;" width="100%" height="100px">
                            <table height="100%" width="100%" id="idItemHoverTable">
                                <tr>
                                    <th scope="col" colspan="2" style="padding-bottom: 8px;">
                                        <span class="ms-linksectionheader">
                                            <h3 class="ms-standardheader">
                                                <SharePoint:EncodedLiteral ID="EncodedLiteral3" runat="server" Text="Here you can control DSRM branding section from." EncodeMethod='HtmlEncode' />
                                            </h3>
                                        </span>
                                    </th>
                                </tr>
                                <tr>
                                    <th scope="row" nowrap>
                                        <SharePoint:EncodedLiteral ID="EncodedLiteral4" runat="server" Text="<% $Resources:wss,settings_siteurl %>" EncodeMethod='HtmlEncode' />:
                                    </th>
                                    <td dir="ltr">
                                        <% SPHttpUtility.HtmlEncode(Web.Url + "/", Response.Output); %>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td valign="top" style="padding: 4px 0px 4px 0px;" height="100%">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ms-propertysheet">
                
                    <wssuc:InputFormSection Title="DSRM Configuration" id="ifStandard" Description="Insert the configuration XML data here" runat="server">                        
                        <template_inputformcontrols>                                                 
                         <wssuc:InputFormControl LabelText="XML Date" runat="server">
				            <Template_Control>
		                        <wssawc:InputFormTextBox CssClass="ms-input" ID="tbXml" Runat="server" TextMode="MultiLine" Columns="60" Rows="30"  />
				            </Template_Control>
			            </wssuc:InputFormControl>
			            </template_inputformcontrols>      
                    </wssuc:InputFormSection>
                    
                     <SPSWC:InputFormButtonSection ID="InputFormButtonSection1" runat="server">
                        <SPSWC:InputFormButtonAtBottom runat="server" ID="cmdOK" OnClick="OnClickOK" CausesValidation="true" TextLocId="Page_OkButton_Text" />
                        <SPSWC:InputFormButtonAtBottom runat="server" ID="cmdCancel" OnClick="OnClickCancel" TextLocId="Page_CancelButton_Text" CausesValidation="false" />
                    </SPSWC:InputFormButtonSection>
                </table>
            </td>
        </tr>
    </table>
</asp:content>
